package com.huishu.user.controller;


import com.huishu.commons.pojo.Result;
import com.huishu.user.pojo.model.NoticeDO;
import com.huishu.user.service.NoticeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author generator@ljj
 * @since 2023-04-27
 */
@RestController
@RequestMapping("/notice")
public class NoticeController {

    @Autowired
    private NoticeService noticeService;

    @GetMapping("/find")
    public Result find() {
        return Result.success(noticeService.getOne(null));
    }

    @PostMapping("/createOrupdate")
    public Result createOrupdate(@RequestBody NoticeDO noticeDO) {
        return noticeService.saveOrUpdate(noticeDO) ? Result.success() : Result.fail();
    }

}
